﻿
<%@ Page Language="C#" Theme="Default" MasterPageFile="~/MasterPages/admin.master" AutoEventWireup="true"  CodeFile="HoaDon.aspx.cs" Inherits="HoaDon" Title="HoaDon List" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Hoa Don List</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
		<data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1" PersistenceMethod="Session" />
		<br />
		<data:EntityGridView ID="GridView1" runat="server"			
				AutoGenerateColumns="False"					
				OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
				DataSourceID="HoaDonDataSource"
				DataKeyNames="MaHoaDon"
				AllowMultiColumnSorting="false"
				DefaultSortColumnName="" 
				DefaultSortDirection="Ascending"	
				ExcelExportFileName="Export_HoaDon.xls"  		
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" ShowEditButton="True" />				
				<data:HyperLinkField HeaderText="Ma Thanh Vien" DataNavigateUrlFormatString="ThanhVienEdit.aspx?MaThanhVien={0}" DataNavigateUrlFields="MaThanhVien" DataContainer="MaThanhVienSource" DataTextField="TenDangNhap" />
				<asp:BoundField DataField="NgayDatHang" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="Ngay Dat Hang" SortExpression="[NgayDatHang]"  />
				<asp:BoundField DataField="TriGia" HeaderText="Tri Gia" SortExpression="[TriGia]"  />
				<data:BoundRadioButtonField DataField="DaGiaoHang" HeaderText="Da Giao Hang" SortExpression="[DaGiaoHang]"  />
				<asp:BoundField DataField="NgayGiaoHang" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="Ngay Giao Hang" SortExpression="[NgayGiaoHang]"  />
				<asp:BoundField DataField="DiaChiGiaoHang" HeaderText="Dia Chi Giao Hang" SortExpression="[DiaChiGiaoHang]"  />
				<asp:BoundField DataField="PhiGiaoHang" HeaderText="Phi Giao Hang" SortExpression="[PhiGiaoHang]"  />
				<asp:BoundField DataField="TinhTrang" HeaderText="Tinh Trang" SortExpression="[TinhTrang]"  />
				<data:HyperLinkField HeaderText="Ma Nhan Vien" DataNavigateUrlFormatString="NhanVienEdit.aspx?MaNhanVien={0}" DataNavigateUrlFields="MaNhanVien" DataContainer="MaNhanVienSource" DataTextField="TenDangNhap" />
			</Columns>
			<EmptyDataTemplate>
				<b>No HoaDon Found!</b>
			</EmptyDataTemplate>
		</data:EntityGridView>
		<br />
		<asp:Button runat="server" ID="btnHoaDon" OnClientClick="javascript:location.href='HoaDonEdit.aspx'; return false;" Text="Add New"></asp:Button>
		<data:HoaDonDataSource ID="HoaDonDataSource" runat="server"
			SelectMethod="GetPaged"
			EnablePaging="True"
			EnableSorting="True"
			EnableDeepLoad="True"
			>
			<DeepLoadProperties Method="IncludeChildren" Recursive="False">
	            <Types>
					<data:HoaDonProperty Name="NhanVien"/> 
					<data:HoaDonProperty Name="ThanhVien"/> 
				</Types>
			</DeepLoadProperties>
			<Parameters>
				<data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" />
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
				<asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex" Type="Int32" />
				<asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize" Type="Int32" />
				<data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
			</Parameters>
		</data:HoaDonDataSource>
	    		
</asp:Content>



